import 'package:flutter/material.dart';


class SettingsPage extends StatelessWidget {
  @override
  Widget build(BuildContext context) {

    return MaterialApp(
      home: Scaffold(
        appBar: AppBar(
          leading: IconButton(
            onPressed: (){},
            icon: const Icon(Icons.ac_unit,color: Colors.cyanAccent,),
          ),
        ),
          body: ListView(
            // padding: EdgeInsets.symmetric(vertical: 16),
            children: [
          Container(
            padding: const EdgeInsets.all(16),
            color: Colors.grey[200],
            child: const Row(
              children: [
                CircleAvatar(
                  radius: 40,
                  backgroundImage: AssetImage('images/pavlova.jpg'),
                ),
                SizedBox(width: 16),
                Column(
                  crossAxisAlignment: CrossAxisAlignment.start,
                  children: [
                    Text(
                      '江上清风山间明月',
                      style: TextStyle(fontSize: 18),
                    ),
                    Text(
                      '用户ID: 123456',
                      style: TextStyle(fontSize: 14, color: Colors.grey),
                    ),
                  ],
                ),
              ],
            ),
          ),
          // SizedBox(height: 16),
          Container(
            color: Colors.grey,
            child: const SizedBox(
              height: 16,
              child: Text(
                'Hello, SizedBox!',
                style: TextStyle(color: Colors.white, fontSize: 10),
              ),
            ),
          ),
          const SettingItem(icon: Icons.person, title: '个人信息'),
          const Divider(indent: 60,),
          const SettingItem(icon: Icons.lock, title: '账号与安全'),
          const Divider(indent: 60,),
          const SettingItem(icon: Icons.notifications, title: '消息通知'),
          const Divider(indent: 60,),
          const SettingItem(icon: Icons.language, title: '语言'),
          const Divider(indent: 60,),
          const SettingItem(icon: Icons.language, title: '语言'),
          const Divider(indent: 60,),
          const SettingItem(icon: Icons.language, title: '语言'),
          const Divider(indent: 60,),
          const SettingItem(icon: Icons.language, title: '语言'),
          const Divider(indent: 60,),
          const SettingItem(icon: Icons.language, title: '语言'),
          const Divider(indent: 60,),
          // 添加更多的设置项...
        ],
          ),
      ),

    );
  }
}

class SettingItem extends StatelessWidget {
  final IconData icon;
  final String title;

  const SettingItem({required this.icon, required this.title,});

  @override
  Widget build(BuildContext context) {
    return ListTile(
      leading: Icon(icon),
      title: Text(title),
      trailing: Icon(Icons.arrow_forward_ios),
      onTap: ()=>{},
    );
  }
}
